%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Introduction
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The concept of time is very complex to handle and interpret~\cite{Klein1994,Shackle1961}, though it is very natural and omnipresent in real world data. As information systems attempt the modelling of natural objects, concepts or processes, they often require modelling temporal aspects or concepts. Thus, several proposals have arisen to obtain theoretical models that allow the modelling or representation of time~\cite{Bolour1982,VanderCruyssen1997}.

A very specific type of information systems are database systems. A database contains data representing real objects or concepts. In real world, some aspects or properties of objects are time-variant or time-related. E.g., the moment of a bank transaction and the status of an employee in a company, are time-related and time-variant notions, respectively.
A temporal database schema is a database schema that models objects with time-related or time-variant properties. However, the modelling of temporal aspects has a direct impact on the consistency of the temporal database, because the temporal nature of these aspects imposes extra integrity constraints and suitable ways of interaction with the human user. 

% For example, let us consider an employee's database containing data about the positions of employees in a company. Two dates are stored: the starting and ending dates respectively of the contract. It is clear that an employee cannot have a contract with an ending date without an starting date. Without further cautions, a manager in the company could insert a new contract for an employee who is already working for the company. A temporal database model will typically constrain record insertion and prevent similar modelling inconsistencies.

For example, let us consider a library database and, concretely, the modelling of the presence of books in the library. Two dates are stored: the loan and the return date. It is clear that a book cannot be loaned again until it is returned. Without further cautions, a library employee could loan the same book several times even if it is not returned. A temporal database model will typically constrain record insertion and prevent similar modelling inconsistencies.

% let us consider a hospital database containing data about the state of the patients in a given hospital. Two dates are stored: the date when the patient arrives to and leaves from the hospital. It is clear that a patient cannot leave the hospital if he or she has not arrived. Without further cautions, a hospital employee could insert a patient who is already in the hospital. 
A lot of research concerns temporal database models and their approaches to the modelling of time. The first efforts were towards the representation of historical information related to objects represented by records in a database~\cite{Clifford1985}. Some proposals tried to extend the Entity Relationship Model~\cite{Klopprogge1983}, without impact on any database standards like SQL~\cite{Sarda1990}.

%Notably, in 1994, ``A Consensus Glossary of Temporal Database Concepts'' was published~\cite{Dyreson1994}. For this publication, 44 temporal database researchers, among them, some of the main researchers in this field, cooperated to reach a consensus on the nature and definitions of some of the main temporal database concepts and terminology. This glossary was updated in 1998~\cite{Dyreson1998}.


% %From time in general to time in information systems
% In real world, some aspects or properties of objects, concepts or processes are time-variant or time-related. For example, the moment of a bank transaction is traditionally a point in time and thus a time-related notion, the function of an employee in a company can change through recorded history and is thus time-variant.  As information systems often attempt the modelling of natural objects, concepts or processes, they often require modelling temporal aspects or concepts. Thus, several proposals have been concerned with obtaining theoretical models that allow the modelling or representation of time~\cite{Bolour1982},~\cite{VanderCruyssen1997}.

% %From time in information systems to time in temporal databases
% Time is a complex concept, which makes modelling time in database systems complex too. A \emph{temporal database} is a database that deals with certain time-related aspects in its schema: a \emph{temporal database schema}~\cite{Dyreson1994} is a database schema that models entities (and interactions or relationships between entities) with time-related or time-variant properties. However, the modelling of temporal properties or aspects has a direct impact on the consistency of the resulting temporal database, because the temporal nature of these aspects or properties imposes extra integrity constraints. An example. Consider a relation in a relational library database, representing the physical absence (or presence) of books in the library. Every physical book is represented by a unique identifier. Every record in the relation contains such an identifier, a date on which the corresponding book was loaned and a date on which it was subsequently returned (if it was returned). As such, every record represents a period of time during which the physical book corresponding with the identifier is loand to a library customer. Without further precautions, a library employee could add several records with the same book identifier, different `loaned'-dates and no `returned'-dates. This group of records would represent the same physical book being loaned several times on different dates and never returned, which is of course impossible. A temporal database model will typically constrain record insertion and prevent similar modelling inconsistencies.

An interesting issue in temporal modelling concerns relationships between temporal notions. In this sense, Allen~\cite{Allen1983} studied temporal relationships between time intervals (and as a special case time points). Among others, the querying of temporal databases has greatly profited from these temporal relationships, because they allow more powerful user-specified temporal query demands, by allowing to express more complex relationships between the temporal notions in the temporal expressions in the query. For example, a query like `who were the department heads when Thomas worked for the institution' can be evaluated using operators similar to Allen's ones.

Humans handle temporal information using certain temporal notions like time intervals or time points~\cite{Dyreson1994}, and they often have to deal with imperfections like imprecision, vagueness, uncertainty or inconsistencies possibly contained in the descriptions of these temporal notions. These imperfections in descriptions of temporal notions determine an important issue in temporal modelling. Consider as an example the description of the temporal notion in a sentence like `The Belfry of Bruges was finished between 01/01/1201 A.D. and 31/12/1300 A.D.'. This sentence contains imperfection because of the uncertainty in the used time-related expression. It is known that the building was finished on a single day, but this day is not precisely known.

To allow information systems to cope with these and similar data imperfections, many approaches adopt fuzzy sets~\cite{Zadeh1965} for the representation and management of temporal information~\cite{Mitra1994,Nagypal2003,Billiet2011,Dubois1983,Dubois2003}. The temporal relationships studied by Allen were fuzzified by several authors~\cite{Ohlbach2004,Nagypal2003,Schockaert2008}.   Garrido et al. ~\cite{Garrido2009} presented a compact representation for the time and defined different relationships among time intervals by using a combination of regular fuzzy comparisons. Also ~\cite{Garrido2009,Pons2011} studied uncertainty in temporal expressions concerning time intervals. Other approaches, like~\cite{Qiang2009}, use rough sets~\cite{Pawlak1995} to represent time intervals.

%Now introducing imperfections in representations of time...
% Humans handle temporal information using certain temporal notions like specific time intervals or instants~\cite{Dyreson1994} and they often have to deal with imperfections like imprecisions, vaguenesses, uncertainties or inconsistencies possibly contained in (the descriptions of) these temporal notions. Among many others, these possible imperfections in (descriptions of) temporal notions determine an important issue in temporal modelling. As an example, consider the temporal notion described in a sentence like `The Belfry of Bruges was finished on a day somewhere between 01/01/1201 A.D. and 31/12/1300 A.D.'. The description of the temporal notion reads `a day somewhere between 01/01/1201 A.D. and 31/12/1300 A.D.'. This temporal notion thus contains imperfection in the form of the uncertainty about the exact day the last stone of the building was laid: it is known that the building was finished on a single day, but it is not known which day this was. To allow information systems to cope with these and similar temporal data imperfections, many approaches adopt fuzzy sets~\cite{Zadeh1965} and/or fuzzy logic to model temporal information~\cite{Mitra1994},~\cite{Nagypal2003},~\cite{Billiet2011},~\cite{Dubois2003}. 

In addition to temporal modelling, some attention has been paid to temporal reasoning~\cite{Allen1983}. Although temporal reasoning is not discussed in this paper, it should be noted that, among others, Dubois and Prade et al.~\cite{Dubois2003,DuBois1989} have dealt with fuzziness and uncertainty in temporal reasoning. Finally, in \cite{rita1,rita2}, an approach to the linguistic summarization of data with time dimension is presented.

The present work defines and implements a model for properly representing and managing uncertainty in valid-time specification in a relational database. Our work is focused on both the proposal of an appropriate formal framework to suitably manage time in databases and the implementation of a DML that allows to the user the transparent use of this proposal. None of the previous research offers a database model to accomplish this task.

This way, together with the theoretical model, we also present and explain the main operations of the manipulation language for a temporal database which stores the valid-time periods of the objects affected by imprecision. The rest of the work is organized as follows. Section \ref{sec:prelim} presents some background concepts about both possibility theory and temporal databases. In section \ref{sec:time-rep} the representation of the valid-time intervals in the database is explained. Section \ref{sec:temporal-model} explains the main concepts of the temporal Data Manipulation Language (DML) and its implementation. Finally, Section \ref{sec:conclusions} presents the conclusions and some guidelines for future research work.


% 
% 
% %From information systems in general to database systems in particular:
% Generally, \emph{information systems} model the structure and behavior of real objects, concepts or processes. A specific type of information systems are \emph{database systems}, which are computer systems designed to manage \emph{databases}. A database is basically a collection of (persistent) data. These (typically atomic) data represent real objects or concepts. In the context of database design, such objects or concepts are typically called \emph{entities} and a collection of similar entities is typically modelled by an \emph{entitytype}, which is basically a combination of a name and a list of \emph{attributes}, which describe properties of the entities. Typically, in an early stage of the database development process, the structures of and interactions or relationships between used entities are modelled in a \emph{design schema}, following some design model. A database thus contains (typically atomic) data. Each (atomic) part of these data is a result value of a measurement of a property of an entity or a description of a property of an entity and will correspond to the attribute of the entity's entitytype, which describes the property.
% 
% %From database models in general to the relational model in particular:
% The structure and behavior of a database, along with some integrity and security restrictions, is dictated by a \emph{database model}. A database model is basically a collection of instructions and regulations, used to (logically) describe the structure and behavior of a database, along with some integrity and security restrictions. Applying a database model to a concrete design schema results in a \emph{database schema}, which models the logical structure and behavior of a database. Several different database models exist, but the most popular is the \emph{relational database model}~\cite{Codd:1970:RMD:362384.362685}. Following the relational database model, entitytypes are modelled as \emph{relations}, which comprise a name and a list of attributes, modelling the entitytype's attributes.
% 
% %From time in general to time in information systems
% In reality, some aspects or properties of objects, concepts or processes are time-variant or time-related. For example, the moment of a bank transaction is traditionally a moment in time and thus a time-related notion, the function of an employee in a company can change through recorded history and is thus time-variant. The concept of time itself is very complex to handle and interpret~\cite{Klein1994},~\cite{Shackle1961}, though it is very natural and omnipresent. As information systems often attempt the modelling of natural objects, concepts or processes, they often require modelling temporal aspects or concepts. Thus, several proposals have been concerned with obtaining theoretical models that allow the modelling or representation of time~\cite{Bolour1982},~\cite{VanderCruyssen1997}.
% 
% %From time in information systems to time in temporal databases
% Time is a complex concept, which makes modelling time in database systems complex too. A \emph{temporal database} is a database that deals with certain time-related aspects in its schema: a \emph{temporal database schema}~\cite{Dyreson1994} is a database schema that models entities (and interactions or relationships between entities) with time-related or time-variant properties. However, the modelling of temporal properties or aspects has a direct impact on the consistency of the resulting temporal database, because the temporal nature of these aspects or properties imposes extra integrity constraints. An example. Consider a relation in a relational library database, representing the physical absence (or presence) of books in the library. Every physical book is represented by a unique identifier. Every record in the relation contains such an identifier, a date on which the corresponding book was loaned and a date on which it was subsequently returned (if it was returned). As such, every record represents a period of time during which the physical book corresponding with the identifier is loand to a library customer. Without further precautions, a library employee could add several records with the same book identifier, different `loaned'-dates and no `returned'-dates. This group of records would represent the same physical book being loaned several times on different dates and never returned, which is of course impossible. A temporal database model will typically constrain record insertion and prevent similar modelling inconsistencies.
% 
% %Research about temporal databases
% A lot of research concerns temporal database models and their approaches to the modelling of time. Some of the first proposals concerned the representation of historical information related to entities~\cite{Clifford1985}. Some proposals tried to extend the Entity Relationship Model~\cite{Klopprogge1983}, without impact on any database standards like SQL~\cite{Sarda1990}. Notably, in 1994, `A Consensus Glossary of Temporal Database Concepts' was published~\cite{Dyreson1994}. For this publication, 44 temporal database researchers, among which some of the main researchers in this field, cooperated to reach a consensus on the nature and definitions of some of the main temporal database concepts and their terminology. This glossary was subsequently updated in 1998~\cite{Dyreson1998}. In the presented work, the concepts and terminology from this glossary are used and followed.
% 
% %Research about temporal relationships
% An interesting issue in temporal modelling concerns the relationships between temporal notions. Notably, Allen~\cite{Allen1983} studied temporal relationships between time intervals~\cite{Dyreson1994} (and, as a special case, instants~\cite{Dyreson1994}). Among others, the querying of temporal databases has greatly profited from these temporal relationships, because they allow for richer and more complex user-specified temporal query demands, by allowing to express more complex relationships between the temporal notions in the temporal expressions in the query and the temporal indications in the database. For example, given a relation representing who was department head of an institution during which time intervals, a query like `Who were the department heads during the time intervals when Thomas worked for the institution?' can be evaluated using similar relationships. %TODO: CHECK THIS LAST SENTENCE
% 
% %Now introducing imperfections in representations of time...
% Humans handle temporal information using certain temporal notions like specific time intervals or instants~\cite{Dyreson1994} and they often have to deal with imperfections like imprecisions, vaguenesses, uncertainties or inconsistencies possibly contained in (the descriptions of) these temporal notions. Among many others, these possible imperfections in (descriptions of) temporal notions determine an important issue in temporal modelling. As an example, consider the temporal notion described in a sentence like `The Belfry of Bruges was finished on a day somewhere between 01/01/1201 A.D. and 31/12/1300 A.D.'. The description of the temporal notion reads `a day somewhere between 01/01/1201 A.D. and 31/12/1300 A.D.'. This temporal notion thus contains imperfection in the form of the uncertainty about the exact day the last stone of the building was laid: it is known that the building was finished on a single day, but it is not known which day this was. To allow information systems to cope with these and similar temporal data imperfections, many approaches adopt fuzzy sets~\cite{Zadeh1965} and/or fuzzy logic to model temporal information~\cite{Mitra1994},~\cite{Nagypal2003},~\cite{Billiet2011},~\cite{Dubois2003}. 
% 
% %Now introducing imperfections in temporal relationships
% The temporal relationships studied by Allen were fuzzified by several authors~\cite{Ohlbach2004},~\cite{Nagypal2003},~\cite{Schockaert2008}. Garrido et al. ~\cite{Garrido2009} present different temporal operators, defined by a combination of fuzzy comparisons. Also,~\cite{Garrido2009},~\cite{Pons2011} studied uncertainty in the context of time intervals. Other approaches, like~\cite{Qiang2009}, use rough sets~\cite{Pawlak1995} to represent time intervals.
% 
% %Imperfections in temporal reasoning
% Next to temporal modelling, some attention has gone to temporal reasoning~\cite{Allen1983}. Although the focus of this paper is temporal modelling, it should be noted that, among others, Dubois and Prade et al.~\cite{Dubois2003},~\cite{DuBois1989} have dealt with fuzziness and uncertainty in temporal reasoning.
% 
% %Overview of this work
% %Include: what is the paper about? (situation and explanation of the problem we will solve and situation of our solution (we use constraints...))
% %Include: how does the solution work? (short summary of how the solution will solve the problem/attend to the problem)
% %Include: What exactly will be presented
% %In all of these: stress every single innovative/novel point of the presented work!
% %TODO: build the overview when the paper is finished
% 
% The aim of this work is to present and explain the main operations of the manipulation language for a temporal database which stores the valid-time periods of the objects with uncertainty. The rest of the work is organized as follows. Section \ref{sec:prelim} presents some background concepts about both possibility theory and temporal databases. In section \ref{sec:time-rep} the representation of the valid-time intervals in the database is explained. Section \ref{sec:temporal-model} explains the main concepts and behaviour of the temporal model. The Data Manipulation Language (DML) is described and implemented. Finally in Section \ref{sec:conclusions} presents the conclusions and some possibilities for future research work.
% 
